<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // 1. if分支
        const age=18

        if(age<18){
            console.log('未成年')
        }else{
            console.log('成年了')
        }
        // 2. switch
        let fruit = '橘子'

        switch (fruit) {
         case '苹果':
        console.log('苹果5元/斤')
         break
         case '橘子':
        console.log('橘子3元/斤')
         break
         default:
        console.log('不好意思，您查询的水果已售罄')
        }
    </script>
</body>
</html>